package indi.zhang.common.config;

import indi.zhang.common.branchs.HandleBeanProcessor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;

@Slf4j
public class CommonConfig {

    @Bean
    @ConditionalOnMissingBean
    @ConditionalOnProperty(value = "indi.zhang.common.branch",matchIfMissing = false, havingValue = "true")
    public HandleBeanProcessor handleBeanProcessor() {
        log.info("branch is started...");
        return new HandleBeanProcessor();
    }

}
